package Math数学运算;

import java.util.Scanner;
//求质数，即只能被1和它本身整除的数
public class text1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        System.out.println(zishu(a));
        System.out.println(zishu1(a));
    }
//方法一
    private static boolean zishu(int a) {
        for (int i = 2; i < a; i++) {
            if (a % i == 0) {
                return false;
            }
        }
        return true;
    }
//方法二，这个效率更高
    private static boolean zishu1(int a) {
        for (int i = 2; i <= Math.sqrt(a); i++) {
            if (a % i == 0) {
                return false;
            }
        }
        return true;
    }
}
